@extends('app')

@section('content')
<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/bbs/top')}}">信息列表</a></li>
    <li><a href="{{ url('/admin/bbs/top/create') }}">信息添加</a></li>
</ul>

<div class="panel panel-default mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
          <thead>
            <tr>
              <th>编号</th>
              <th>缩略图</th>
              <th>帖子标题</th>
              <th>作者</th>
              <th>发布时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          @foreach($hotlist as $res)
            <tr id="news_{{ $res->question_id }}">
              <td>{{ $res->question_id }}</td>
              <td><img src="{{$res->thumb}}" width="70"></td>
              <td><a href="{{ url('/admin/bbs/top/'.$res->question_id.'/edit') }}">{{ $res->getQuestion->title }} </a></td>
              <td>{{ getUserName($res->getQuestion->publish_uid) }}</td>
              <td>{{ $res->created_at}}</td>
              <td>
                <a href="{{ url('/admin/bbs/top/'.$res->question_id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="javascript:void(0);" onclick="delete_one('/admin/bbs/top/{{$res->question_id}}','{{$res->question_id}}','{{ csrf_token() }}')"><i class="glyphicon glyphicon-remove-sign"></i></a>
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
    </div>
</div>
<div>{!! $hotlist->render() !!} </div>

@endsection
